﻿using Framework.Core.BootStrapper;
using Framework.Remoting.Hosting;
using Rhino.Mocks;
using Xunit;

namespace Framework.Wcf.ServiceImplementation.Tests
{
    public class EntryPointTest
    {
        [Fact]
        public void Should_bootstrap_service()
        {
            var args = new[] { "pouet" };
            var mockRepository = new MockRepository();
            var bootStrapperMock = mockRepository.StrictMock<IBootStrapper>();
            Program.BootStrapper = bootStrapperMock;

            bootStrapperMock.Expect(x => x.Add<WcfHost>()).Return(bootStrapperMock);
            bootStrapperMock.Expect(x => x.Start(args));

            mockRepository.ReplayAll();
            Program.Main(args);
            mockRepository.VerifyAll();
        }
    }
}
